#include <iostream>
#include <regex>
#include <string>

int main()
{
    std::string str = "/numbers/1234";
    std::regex e("/numbers/(\\d+)");//匹配规则 \转义\d+,()表示提取
    std::smatch matches;//typedef match_results<string::const_iterator>	 smatch;
    //    class match_results: private std::vector<sub_match<_Bi_iter>, _Alloc>
    bool ret = std::regex_match(str,matches,e);
    if(!ret)
    {
        return -1;
    }

    for(auto & s:matches)
    {
        std::cout<<s<<std::endl;
    }
    return 0;
}